package com.concurrent.chapter9.concurrent03;

import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;

public class Test2 {
	public static void main(String[] args) {
		try {
			MyRecursiveTask task1 = new MyRecursiveTask();
			System.out.println(task1.hashCode());
			ForkJoinPool pool = new ForkJoinPool();
			ForkJoinTask<Integer> task2 = pool.submit(task1);
			//使用join获取返回值
			System.out.println(task2.hashCode() + " " + task2.join());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
